package org.spring.aop.support;

import org.aopalliance.aop.Advice;

/**
 * 允许配置任何 {@link Advice} 的抽象通用 {@link org.spring.aop.PointcutAdvisor}。
 *
 * @author 李坤
 * @date 2022/4/19 17:25
 */
public abstract class AbstractGenericPointcutAdvisor extends AbstractPointcutAdvisor {

    private Advice advice = EMPTY_ADVICE;

    @Override
    public Advice getAdvice() {
        return this.advice;
    }

    /**
     * 指定该顾问应该应用的建议。
     */
    public void setAdvice(Advice advice) {
        this.advice = advice;
    }

    @Override
    public String toString() {
        return getClass().getName() + ": advice [" + getAdvice() + "]";
    }

}
